package com.zookeeper.basic.two.curator;

import com.sun.net.httpserver.Authenticator;
import org.apache.curator.RetryPolicy;
import org.apache.curator.framework.CuratorFramework;
import org.apache.curator.framework.CuratorFrameworkFactory;
import org.apache.curator.retry.ExponentialBackoffRetry;

/**
 * Created by 58 on 2016-7-17.
 * 使用Curator客户端连接zookeeper
 */
public class CuratorCreateSession {
    public static void main(String[] args) throws InterruptedException {
        RetryPolicy retryPolicy = new ExponentialBackoffRetry(1000,300);
        CuratorFramework framework = CuratorFrameworkFactory.newClient("127.0.0.1:2181",5000,3000,retryPolicy);
        framework.start();
        Thread.sleep(Integer.MAX_VALUE);

    }
}
